# Start from a Java image.
FROM 192.168.59.250/choosefine/java:latest

# Rocketmq version
ENV ROCKETMQ_VERSION 4.1.0-incubating
ENV JAVA_HOME /opt/jdk1.8.0_111
# Rocketmq home
ENV ROCKETMQ_HOME  /opt/rocketmq-${ROCKETMQ_VERSION}



WORKDIR  ${ROCKETMQ_HOME}

RUN mkdir -p \
		/opt/logs \
	    /opt/store

ADD rocketmq-all-4.1.0-incubating ${ROCKETMQ_HOME}
#RUN curl https://dist.apache.org/repos/dist/release/incubator/rocketmq/${ROCKETMQ_VERSION}/rocketmq-all-${ROCKETMQ_VERSION}-bin-release.zip -o rocketmq.zip \
#          && unzip rocketmq.zip \
#          && mv apache-rocketmq-all/* . \
#          && rmdir apache-rocketmq-all  \
#          && rm rocketmq.zip


RUN chmod +x bin/mqbroker

CMD cd ${ROCKETMQ_HOME}/bin && export JAVA_OPT=" -Duser.home=/opt" && sh mqbroker


EXPOSE 10909 10911
VOLUME /opt/logs \
		/opt/store

